package com.fatdetection.demo.controller;


import com.fatdetection.demo.annotation.AuthAdmin;
import com.fatdetection.demo.annotation.AuthOperator;
import com.fatdetection.demo.bean.Reference;
import com.fatdetection.demo.service.ReferenceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/reference")
@RestController
@AuthAdmin
@AuthOperator
public class ReferenceController {

    @Autowired
    ReferenceService referenceService;

    @GetMapping("/getByPart/{partName}")
    public Reference getByPart(@PathVariable("partName") String partName){
        return referenceService.getReference(partName);
    }

}
